/*
 * File:
 *
 * Author: henrya
 *
 * Created on June 26, 2009, 6:54 PM
 */

#ifndef _ROUTINGTABLE_H
#define	_ROUTINGTABLE_H

#include <vector>
#include <string>
using std::vector;
using std::string;

class RoutingTable {
public:
    RoutingTable(int nodeId, vector<int>* allNodes);
    RoutingTable(const RoutingTable* orig);
    virtual ~RoutingTable();
    bool update(RoutingTable& table);
    int getId();
    string* printRT();
    void setVersion(unsigned int version);
    unsigned int getVersion();
    int getNextOnPath(int dest);
private:
    int getNodeNumber(unsigned int index);
    unsigned int indexOf(int nodeNumber);
private:
    int nodeId;
    vector<int> allNodes;
    int* distance;
    int* nextNode;
    unsigned int* lastVersion;
    unsigned int version;
};

#endif	/* _ROUTINGTABLE_H */

